package com.hzj.springcloud.service;

import com.hzj.springcloud.pojo.Dept;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

//参数为：服务名，服务降级类
@FeignClient(value = "SPRINGCLOUD-PROIVDER-DEPT-8001",fallbackFactory = DeptClientServiceFallbackFactory.class)
@Service//注入到容器
public interface DeptClientService {
    @RequestMapping("/dept/list")//当调用show方法时就会通过@RequestMapping("/dept/list")调用服务中提供者的Controller请求
    public List<Dept> show();
}
